package com.xyc.redis.controller;

import com.xyc.redis.pojo.TbProduct;
import com.xyc.redis.service.RedisServiceImpl;
import com.xyc.redis.vo.ProductVO;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;
import java.util.List;

@Controller
public class RedisController {
    @Resource
    private RedisServiceImpl redisServiceImpl;
    @RequestMapping("toRedisPage")
    public String toRedisPage(Model model){
        List<ProductVO> tbProducts = redisServiceImpl.selectProductList(1);
        model.addAttribute("list",tbProducts);
        return "index";
    }



}
